home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
atari
/
c
/
crc_lib2
/
crc.txt
< prev
Wrap
Text File
|
1995-01-09
|
5KB
|
134 lines
CRC.LIB - written by Jan Kriesten
================================================================================
(c) 1994,1995 by Jan Kriesten, all rights reserved.
Author: Jan Kriesten
Friedhofstr. 25 b
35043 Marburg
Germany
EMail: Maus GI
90:400/1002@nest.ftn
51:601/103@atarinet.ftn
2:244/4344@fidonet.org
================================================================================
Introduction:
=============
CRC calculation is an important thing if one wants to check occuring
errors/changes to certain data packets/files, e.g. during transfering
data via modem.
This is the reason why CRC calculation is a question of time, too. To
get best transfer rates during data transmission via modem one needs
also fast CRC calculation.
The fastest way to calculate the CRC sum is byte by byte with a preset
crc table. This method was integrated in the library with the crc tables
included.
Also, all CRC calculations are highly optimized and written in
assembler.
As far as I know there are currently three CRC standards which are
widely used in verifying data:
Type | Polynom
---------------------+---------------------------------------------------
CRC-16 | x^16 + x^15 + x^2 + 1
CRC-16 (CCITT V.41) | x^16 + x^12 + x^5 + 1
CRC-32 (ANSI X3.66) | x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11
| + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
All three are integrated in this library.
Copyright:
==========
Copyright (c) 1994,1995 by Jan Kriesten
Please notice that the library is not 'public domain' or 'freeware',
but it's allowed to spread it out (without charging fees) via public
BBS or public networks like FidoNet. In any case the original archive
has to be spread out and must not be modified.
It's not allowed to make this library available via other channels like
pd disk series, cd rom's or channel videodat.
Using this library in commercial/shareware programs is only allowed with
permission of the author.
Disclaimer:
===========
Every care is taken to ensure that these routines are bug free and will
not cause any trouble on your system.
However, I take no responsibility for any harm that may occur to your
system by using this library.
Description:
============
The library is designed to be used together with PureC. To use the
routines you just have to move crc.h and crc.lib to the corresponding
include-/library folder of PureC and add crc.lib to your project file.
The following routines are available. Please refer to the file
crc.h for further descriptions:
/*
* CRC-CCITT
*/
unsigned int Crc16cStr( unsigned char *str );
unsigned int Crc16cBlk( unsigned char *blk, unsigned long length );
unsigned int Crc16cUpd( unsigned int crc, unsigned char c );
unsigned int Crc16cBlkUpd( unsigned int oldcrc, unsigned char *blk, unsigned long length );
unsigned int Crc16cShort( unsigned int oldcrc, unsigned char *blk, int length );
/*
* The return values of the following functions have to be
* negated at the _end_ of calculation!
*/
/*
* CRC-16
*/
unsigned int Crc16Str( unsigned char *str );
unsigned int Crc16Blk( unsigned char *blk, unsigned long length );
unsigned int Crc16Upd( unsigned int crc, unsigned char c );
unsigned int Crc16BlkUpd( unsigned int oldcrc, unsigned char *blk, unsigned long length );
unsigned int Crc16Short( unsigned int oldcrc, unsigned char *blk, int length );
/*
* CRC-32
*/
unsigned long Crc32Str( unsigned char *str );
unsigned long Crc32Blk( unsigned char *blk, unsigned long length );
unsigned long Crc32Upd( unsigned long crc, unsigned char c );
unsigned long Crc32BlkUpd( unsigned long oldcrc, unsigned char *blk, unsigned long length );
unsigned long Crc32Short( unsigned long oldcrc, unsigned char *blk, int length );
Trailer:
========
This library will be supported - or not. This is depending on how
many people are using - and supporting - this library. If you like
this library and you're using it in your own programs you should think
of making a donation for it. Any donation is welcome and will increase
my motivation of supporting it further.
My bank account:
Jan Kriesten, Citibank
Kto.-Nr. 0910680784
BLZ 300 209 00
Any suggestions or bug reports please send to any of the above EMail
adresses.
===============================[ End of CRC.TXT ]===============================